﻿<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-linux;$(NetCoreAppCurrent)-osx;$(NetCoreAppCurrent)-maccatalyst;$(NetCoreAppCurrent)-freebsd;$(NetCoreAppCurrent)</TargetFrameworks>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <UseCompilerGeneratedDocXmlFile>false</UseCompilerGeneratedDocXmlFile>
  </PropertyGroup>

  <!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
  <PropertyGroup>
    <TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
    <GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetPlatformIdentifier)' == ''">SR.FileSystemWatcher_PlatformNotSupported</GeneratePlatformNotSupportedAssemblyMessage>
  </PropertyGroup>

  <ItemGroup Condition="'$(TargetPlatformIdentifier)' != ''">
    <Compile Include="System\HResults.cs" />
    <Compile Include="System\IO\ErrorEventArgs.cs" />
    <Compile Include="System\IO\ErrorEventHandler.cs" />
    <Compile Include="System\IO\FileSystemEventArgs.cs" />
    <Compile Include="System\IO\FileSystemEventHandler.cs" />
    <Compile Include="System\IO\FileSystemWatcher.cs">
      <SubType>Component</SubType>
    </Compile>
    <Compile Include="System\IO\InternalBufferOverflowException.cs" />
    <Compile Include="System\IO\NotifyFilters.cs" />
    <Compile Include="System\IO\RenamedEventArgs.cs" />
    <Compile Include="System\IO\RenamedEventHandler.cs" />
    <Compile Include="System\IO\WatcherChangeTypes.cs" />
    <Compile Include="System\IO\WaitForChangedResult.cs" />
    <Compile Include="$(CommonPath)DisableRuntimeMarshalling.cs"
             Link="Common\DisableRuntimeMarshalling.cs" />
    <Compile Include="$(CommonPath)System\IO\PathInternal.CaseSensitivity.cs"
             Link="Common\System\IO\PathInternal.CaseSensitivity.cs" />
    <Compile Include="$(CommonPath)System\IO\PathInternal.cs"
             Link="Common\System\IO\PathInternal.cs" />
    <Compile Include="$(CommonPath)System\Text\ValueStringBuilder.cs"
             Link="Common\System\Text\ValueStringBuilder.cs" />
    <Compile Include="$(CommonPath)System\Obsoletions.cs"
             Link="Common\System\Obsoletions.cs" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'windows'">
    <Compile Include="$(CommonPath)System\IO\PathInternal.Windows.cs"
             Link="Common\System\IO\PathInternal.Windows.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Interop.Libraries.cs"
             Link="Common\Interop\Windows\Interop.Libraries.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Interop.BOOL.cs"
             Link="Common\Interop\Windows\Interop.BOOL.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.SECURITY_ATTRIBUTES.cs"
             Link="Common\Interop\Windows\Interop.SECURITY_ATTRIBUTES.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.FileOperations.cs"
             Link="Common\Interop\Windows\Kernel32\Interop.FileOperations.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.ReadDirectoryChangesW.cs"
             Link="Common\Interop\Windows\Kernel32\Interop.ReadDirectoryChangesW.cs" />
    <Compile Include="System\IO\FileSystemWatcher.Win32.cs">
      <SubType>Component</SubType>
    </Compile>
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.CloseHandle.cs"
             Link="Common\Interop\Windows\Interop.CloseHandle.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.CreateFile.cs"
             Link="Common\Interop\Windows\Interop.CreateFile.cs" />
  </ItemGroup>

  <!-- Unix -->
  <ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows'">
    <Compile Include="$(CommonPath)Interop\Unix\Interop.Libraries.cs"
             Link="Common\Interop\Unix\Interop.Libraries.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Read.cs"
             Link="Common\Interop\Unix\libc\Interop.Read.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\Interop.Errors.cs"
             Link="Common\Interop\Unix\Interop.Errors.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\Interop.IOErrors.cs"
             Link="Common\Interop\Unix\Interop.IOErrors.cs" />
    <Compile Include="$(CommonPath)System\IO\PathInternal.Unix.cs"
             Link="Common\System\IO\PathInternal.Unix.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.PathConf.cs"
             Link="Common\Interop\Unix\Interop.PathConf.cs" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'linux' or '$(TargetPlatformIdentifier)' == 'freebsd'">
    <Compile Include="System\IO\FileSystemWatcher.Linux.cs" />
    <Compile Include="$(CommonPath)Interop\Linux\System.Native\Interop.INotify.cs"
             Link="Common\Interop\Linux\Interop.inotify.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Poll.cs"
             Link="Common\Interop\Unix\Interop.Poll.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\Interop.Poll.Structs.cs"
             Link="Common\Interop\Unix\Interop.Poll.Structs.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Stat.cs"
             Link="Common\Interop\Unix\Interop.Stat.cs" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'osx' or '$(TargetPlatformIdentifier)' == 'maccatalyst'">
    <Compile Include="System\IO\FileSystemWatcher.OSX.cs" />
    <Compile Include="$(CoreLibSharedDir)System\IO\FileSystem.Exists.Unix.cs"
             Link="System\IO\FileSystem.Exists.Unix.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\Interop.DefaultPathBufferSize.cs"
             Link="Common\Interop\Unix\Interop.DefaultPathBufferSize.cs" />
    <Compile Include="$(CommonPath)Interop\OSX\Interop.EventStream.cs"
             Link="Common\Interop\OSX\Interop.EventStream.cs" />
    <Compile Include="$(CommonPath)Interop\OSX\Interop.CoreFoundation.cs"
             Link="Common\Interop\OSX\Interop.CoreFoundation.cs" />
    <Compile Include="$(CommonPath)Interop\OSX\Interop.Libraries.cs"
             Link="Common\Interop\OSX\Interop.Libraries.cs" />
    <Compile Include="$(CommonPath)Interop\OSX\Interop.RunLoop.cs"
             Link="Common\Interop\OSX\Interop.RunLoop.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.RealPath.cs"
             Link="Common\Interop\Unix\Interop.RealPath.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Stat.Span.cs"
             Link="Common\Interop\Unix\Interop.Stat.Span.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Stat.cs"
             Link="Common\Interop\Unix\Interop.Stat.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Sync.cs"
             Link="Common\Interop\Unix\Interop.Sync.cs" />
    <Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\SafeCreateHandle.OSX.cs"
             Link="Common\Microsoft\Win32\SafeHandles\SafeCreateHandle.OSX.cs" />
    <Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\SafeEventStreamHandle.OSX.cs"
             Link="Common\Microsoft\Win32\SafeHandles\SafeEventStreamHandle.OSX.cs" />
    <Compile Include="$(CommonPath)System\Text\ValueUtf8Converter.cs"
             Link="Common\System\Text\ValueUtf8Converter.cs" />
  </ItemGroup>

  <ItemGroup>
    <Reference Include="Microsoft.Win32.Primitives" />
    <Reference Include="System.ComponentModel" />
    <Reference Include="System.ComponentModel.Primitives" />
    <Reference Include="System.Memory" />
    <Reference Include="System.Runtime" />
    <Reference Include="System.Runtime.InteropServices" />
    <Reference Include="System.Threading" />
    <Reference Include="System.Threading.Overlapped" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows'">
    <Reference Include="System.Collections" />
    <Reference Include="System.Threading.Thread" />
  </ItemGroup>

</Project>
